package com.xzzz.expand.es.core;

import lombok.extern.slf4j.Slf4j;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 配置各类处理类
 * @author xzzz
 */
@Slf4j
@Configuration
@AutoConfigureAfter(EsClientConfig.class)
public class EsConfiguration {

    @Bean
    public EsIndicesManager esIndicesManager(RestHighLevelClient restHighLevelClient, EsProperties esProperties) {
        return new EsIndicesManager(restHighLevelClient, esProperties);
    }

    @Bean
    public EsCurdManager esCurdManager(RestHighLevelClient restHighLevelClient, EsProperties esProperties) {
        return new EsCurdManager(restHighLevelClient, esProperties);
    }

    @Bean
    public EsSearchManager esSearchManager(RestHighLevelClient restHighLevelClient, EsProperties esProperties) {
        return new EsSearchManager(restHighLevelClient, esProperties);
    }
}
